package cn.schoolwow.workflow.test.module.analyzeWorkReport.audit.single.common.handler;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.listener.TryCatchFinallyHandler;
import cn.schoolwow.workflow.test.module.analyzeWorkReport.audit.single.common.CheckWorkFlowResult;
import cn.schoolwow.workflow.test.module.analyzeWorkReport.audit.single.start.StartAnalyzeWorkReportAuditFlow;
import cn.schoolwow.workflow.test.module.analyzeWorkReport.audit.single.start.SubmitAnalyzeWorkReportFlow;

public class AuditTestCaseFlowTryCatchFinallyHandler implements TryCatchFinallyHandler {
    @Override
    public void handleTryStart(FlowContext flowContext) throws Exception {
        flowContext.putTemporaryData("deployName", "分析工作报告审批");

        flowContext.executeFlowList(new StartAnalyzeWorkReportAuditFlow(),
                new SubmitAnalyzeWorkReportFlow());
    }

    @Override
    public void handleTryEnd(FlowContext flowContext) throws Exception {
        flowContext.executeFlowList(new CheckWorkFlowResult());
    }

    @Override
    public void handleException(FlowContext flowContext, Exception e) {

    }

    @Override
    public void handleFinally(FlowContext flowContext) {

    }

    @Override
    public String name() {
        return "审批测试用例全局处理器";
    }
}
